import http from '@/http'

export function like (InviId, UserId) {
  const data = { InviId, UserId }
  return http.put('rest/Invi/like', data)
}

export function star (InviId, UserId) {
  const data = { InviId, UserId }
  return http.put('rest/Invi/star', data)
}

export function getInviById (id) {
  return http.get(`rest/Invi/${id}`)
}

export function report (Rid, id, reason) {
  const data = { Rid, id, reason }
  return http.post('rest/Report', data)
}

export function sendComment (id, main, InviId) {
  const data = { id, main, InviId }
  return http.put('rest/Comment', data)
}

export function deleteInvi (InviId, id) {
  return http.delete(`rest/Invi/${id}/${InviId}`)
}

export function getInvi (page) {
  return http.get(`rest/Invi/page/${page}`)
}

export function sendInvi (id, Invi) {
  const data = { id, ...Invi }
  return http.post('rest/Invi', data)
}

export function deleteComment (InviId, CommentId) {
  return http.delete(`rest/Comment/${InviId}/${CommentId}`)
}

export function RefreshInvi () {
  return http.get('rest/Invi')
}
